#include "GLHeaders.hpp"
#include "Random.hpp"

Random::Random(void){
  seed = 0;
}

GLfloat Random::Rand(void){
  unsigned int tmp;
  seed *= 16807;
  tmp = ((seed & 0x007fffff) | 0x40000000);
  return( *((GLfloat*)&tmp) - 3.0f );
}

void Random::SetSeed(unsigned int value){
  seed = value;
}

unsigned int Random::GetSeed(void) const{
	return seed;
}
